package com.javademo.multithreadingtest;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class MultithreadingTest {
    public static void main(String[] args) throws InterruptedException {
        Thread thread1 = new MyThread();
        thread1.start();
        Thread thread2 = new Thread(new MyRunnable());
        thread2.start();
        thread1.join();
        Thread thread3 = new Thread(() -> log.info("Lambda run"));
        thread3.start();
    }
}

@Slf4j
class MyThread extends Thread {
    @Override
    public void run() {
        log.info("MyThread1 run");
    }
}

@Slf4j
class MyRunnable implements Runnable {
    @Override
    public void run() {
        log.info("MyRunnable run");
    }
}
